UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sYaNKMvxUUiEbuoxkYnm2IZMhL97CVOmg8UNXwibGWA='
WHERE
key_id = 'd88d6e7e082bdab8f65cc8f7023a4176f9de83fbec17977bc75699711790a32c'
AND (
token = 'sYaNKMvxUUiEbuoxkYnm2IZMhL97CVOmg8UNXwibGWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)