UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uKjoBrJyNKv/gAIKTe/XeWEzvj6ZfHWRKw54ckk6b5A='
WHERE
key_id = '7ae94f58e0e8f23dd4df7f2e973c3b81d5e28f340a672a6063f3b022c907041a'
AND (
token = 'uKjoBrJyNKv/gAIKTe/XeWEzvj6ZfHWRKw54ckk6b5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)