UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v0kEFS8cnqDZAx9INbn6Yr7qDxJOfN0N3Kidg5Tk+pY='
WHERE
key_id = '0af6c9db89fb0633cea47cbe87b0ba46db36aaaaf0bd679326cb5d763e8cd809'
AND (
token = 'v0kEFS8cnqDZAx9INbn6Yr7qDxJOfN0N3Kidg5Tk+pY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)