UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gCY1l2wpwz3cO6JH2MdldGAp0o/I//78CHOMWtIYtUU=' 
WHERE 
  key_id = '6ec25c2c920169f8fb5a1111d24bcd4c877d08f849369d7714fb9a4bbbcb09e5' 
  AND (
    token = 'gCY1l2wpwz3cO6JH2MdldGAp0o/I//78CHOMWtIYtUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025