UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i8h288nxUDTVn5CII61LmiFGs68fOVk+s6ZsvMyxSXE='
WHERE
key_id = 'f4e9e24cecb50be1fb22f977eb6438a67c53a63e34b280e6c69b86ef196c0c08'
AND (
token = 'i8h288nxUDTVn5CII61LmiFGs68fOVk+s6ZsvMyxSXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)