UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FgVM/lUfjhHpD0BmGRId0V2ij7d16EtABl46H7FAyKk=' 
WHERE 
  key_id = '45c9d16555b2a6d8bfbefd8a5c6366fe01a430769c9afe28c3314fc6ad4a3c53' 
  AND (
    token = 'FgVM/lUfjhHpD0BmGRId0V2ij7d16EtABl46H7FAyKk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024