UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vpo6nX4zQ5W3oEYX7hPJ524ITYrXn4pYF+8SMO6F110='
WHERE
key_id = '0f4318834a888beff087a93727a69700a95fc61803ec3b68645875567ecd1d59'
AND (
token = 'vpo6nX4zQ5W3oEYX7hPJ524ITYrXn4pYF+8SMO6F110='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)