UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Ki9Yx38dD0kzi0VQgNv+InRIw229XKVzh0uqRH+WcM=' 
WHERE 
  key_id = '10fe00f37f57a00a10edec458f424f2d7762aea016faa390fa40f1dfe8658279' 
  AND (
    token = '6Ki9Yx38dD0kzi0VQgNv+InRIw229XKVzh0uqRH+WcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019