UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OgGy5LNmO/x0Unzm2slrmFZjNXs2RKxtWCtq9nqt+8k=' 
WHERE 
  key_id = '79b86c455fcc9e47aa88cd95d772b7c5c289c8c21cb0a2aa474f090dac1e452e' 
  AND (
    token = 'OgGy5LNmO/x0Unzm2slrmFZjNXs2RKxtWCtq9nqt+8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031