UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xwxX6PPXT2sYcTRfOJI8nW2mR49Ck22EsZwi6htpi7E='
WHERE
key_id = 'f4eb4acadf50dfd838976d72b089f095acf59326d56337db44338ec537991cf7'
AND (
token = 'xwxX6PPXT2sYcTRfOJI8nW2mR49Ck22EsZwi6htpi7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)