UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wx6DDxFvaLc3UbQ/Isek+LjEraz20Bn4UnmhZaAw24M='
WHERE
key_id = '733d71722fe9350ae09a3eed0c1ebd34e790dd106c6577bd62d40aab6bf3d7a3'
AND (
token = 'Wx6DDxFvaLc3UbQ/Isek+LjEraz20Bn4UnmhZaAw24M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)