UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oCO264+eJpnNpEDOjyi/gWmqd1WGHQZ8cy7dqbHcG6A='
WHERE
key_id = 'b08684b4f1506590d56e2e4b9585d01b0031cf535fff8cec7d51d49286e6b7f3'
AND (
token = 'oCO264+eJpnNpEDOjyi/gWmqd1WGHQZ8cy7dqbHcG6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)