UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8KQ5+ZAgqo6tScMHqIRk5L63Ym5AbQ2DgYACehXgy/g=' 
WHERE 
  key_id = '955461288631706f37e104bef0ee29c98a31204384c389dfb90bbdae5ebf4236' 
  AND (
    token = '8KQ5+ZAgqo6tScMHqIRk5L63Ym5AbQ2DgYACehXgy/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034