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