UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nq/lRhFquFDbzbk7f5rdu8alsrJcuJ6/nKXpjHSZJmQ=' 
WHERE 
  key_id = '6c0fb415b0e48f6cc194bd82d56536f710efceecceaa35cb4a265ed5d5730b76' 
  AND (
    token = 'Nq/lRhFquFDbzbk7f5rdu8alsrJcuJ6/nKXpjHSZJmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022