UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mf7ER6INv/iJ2k4ZGMA9beitUo6RsliN0PqtonYpshs=' 
WHERE 
  key_id = '907c473d8ffe847420b9d5da60cf414a5b125cef39859a68d448a2209541bd31' 
  AND (
    token = 'mf7ER6INv/iJ2k4ZGMA9beitUo6RsliN0PqtonYpshs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018