UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4l6ETVFlsCZqXwu9BIf7+ChD4WL5L8SOJBcJdJFFoIU='
WHERE
key_id = '19f89883f4dfb647528caa5ea99e31b891a23d21beae3109098aa69660dd6f07'
AND (
token = '4l6ETVFlsCZqXwu9BIf7+ChD4WL5L8SOJBcJdJFFoIU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)