UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eExn3NPR582AXWAhJbQC1KwGZ26iMmkJYKbdmcKBooE='
WHERE
key_id = '8f9fb7d2eb76c93d4cc8df1b949fff2ff3f10259ff98767dcb90f7cf98545c9c'
AND (
token = 'eExn3NPR582AXWAhJbQC1KwGZ26iMmkJYKbdmcKBooE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)