UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y9pQWjG/KgV5HgVW+pttMOv5D1BR1p+PbWaCfatRZ9M='
WHERE
key_id = 'af6b833ac2fae0bbe133f5252e36a2702e175500a09a96d1db6d1f4e9a207c59'
AND (
token = 'y9pQWjG/KgV5HgVW+pttMOv5D1BR1p+PbWaCfatRZ9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)