UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EX6L9G2eR4MaejlLc2FKh+WTlRCfVMGxlN3QGeJ6WLI='
WHERE
key_id = '04a4a99488c5ada9d877354c2cb8cb8de28510afab3c3e1305bd0ececb714fc4'
AND (
token = 'EX6L9G2eR4MaejlLc2FKh+WTlRCfVMGxlN3QGeJ6WLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)