UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SvKbKbZLFHfLuuuxjQjH+wBNeaN1vQwZMw6WGe+ZnuQ='
WHERE
key_id = '558bae171b91573ada728ade1aa4708ac73a3d1f60c751f6f5bb9603c993e7be'
AND (
token = 'SvKbKbZLFHfLuuuxjQjH+wBNeaN1vQwZMw6WGe+ZnuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)