UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7kKZo1pKMJUotUBntdNLxOtJbOqc7G0I1A/0yIyDVKg='
WHERE
key_id = '36a84ce9f42f6a0e686f463f3f33d8ae49b15f1c695b9d23e6322147ccd651b5'
AND (
token = '7kKZo1pKMJUotUBntdNLxOtJbOqc7G0I1A/0yIyDVKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)