UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8+w7jJJ1byOaHY2KKj6kQt6ef/bO9blsemwm7JLpKGc='
WHERE
key_id = 'c8a44702e18527c042258db829d73304d9afc10b7c1d4e176f674c0522e17ec9'
AND (
token = '8+w7jJJ1byOaHY2KKj6kQt6ef/bO9blsemwm7JLpKGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)