UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7z374rmC//Vf7U80lnSYQPoZVVWX5mBchKAXWPmjvDk=' 
WHERE 
  key_id = '006f47d363b16ec6bc5a1590cfd1b466f025f96d3f4d641c6155799c77c805e7' 
  AND (
    token = '7z374rmC//Vf7U80lnSYQPoZVVWX5mBchKAXWPmjvDk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038