UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '++uKSBMJ6Zlnvs1TMTXci/6yxlhD0S6Fb+ZBbUQ5xas=' 
WHERE 
  key_id = '1fdb9af236747f6136d5b65e37cde6edd9cdb6c0ba3545fa6b87c48ff30c6f3a' 
  AND (
    token = '++uKSBMJ6Zlnvs1TMTXci/6yxlhD0S6Fb+ZBbUQ5xas=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027