UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+b8e0aFTxu+G/f8VKGuuCY1rrZsyqHMNZW7oUJrxMLg=' 
WHERE 
  key_id = 'a26299a85ecbcf1d289229fa742ce2869db942229c38657129971b8752820d80' 
  AND (
    token = '+b8e0aFTxu+G/f8VKGuuCY1rrZsyqHMNZW7oUJrxMLg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022