UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YuuDTTAydx8/BxbwVrWbiRVNk7SL2nEbWKfkSfBDOYI=' 
WHERE 
  key_id = '8f715be7290ead75b69f519c03e2c3c531a903f2d287fb8a0793e799da00177c' 
  AND (
    token = 'YuuDTTAydx8/BxbwVrWbiRVNk7SL2nEbWKfkSfBDOYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030