UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v9DmLU2ACZUdfv4+edkHLlBs/Z26SUKzFOGgVXkUXO0=' 
WHERE 
  key_id = '04d1278f1d6d8e4f6609ae51cdb6f578835b9cddff09155014440162ff9eb84d' 
  AND (
    token = 'v9DmLU2ACZUdfv4+edkHLlBs/Z26SUKzFOGgVXkUXO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023