UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+vjGRdBgb/ogCafSjy9Cijwl7yhRF+VC7j0JlaujUM0='
WHERE
key_id = '310b9d9180052b65ed0a8ebb52aae3e5a70ac622ae1bdcfa140a3d807826e964'
AND (
token = '+vjGRdBgb/ogCafSjy9Cijwl7yhRF+VC7j0JlaujUM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)