UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jIQIH88xeIePHxxDS03R+XVtuXult1NvEeq3ZJPqH5g='
WHERE
key_id = 'bfe14f1a8cd71897f8516a47446ba75fff8ab05232caf15cfb6715ad54d416a2'
AND (
token = 'jIQIH88xeIePHxxDS03R+XVtuXult1NvEeq3ZJPqH5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)