UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RDMUOAkQiyjc8jTTjKaeejmfZjMxJt3mbhe2f3xWxI4='
WHERE
key_id = '86bbf9fd3e232a0a8973e67b5e2f64dec69a127bb195335fb62818454c99076b'
AND (
token = 'RDMUOAkQiyjc8jTTjKaeejmfZjMxJt3mbhe2f3xWxI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)