UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b2cC0ALCLOkEusosKAjJp5rXE2rGjMCHpiEaDXhy7TQ='
WHERE
key_id = '364c3619ab65cf5a8367db3d11c06f75ee1daaac33e439fd70d4f43538d34cd9'
AND (
token = 'b2cC0ALCLOkEusosKAjJp5rXE2rGjMCHpiEaDXhy7TQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)