UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5PS895VJVL2uT4+lKk/6UjZLO3xCFmUX/NS6JYNRN2I='
WHERE
key_id = '3525f58c4f187b11f10d28cfb347474f19993979bc87a528a55b39adee66a18a'
AND (
token = '5PS895VJVL2uT4+lKk/6UjZLO3xCFmUX/NS6JYNRN2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)