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